﻿@model IEnumerable<Mvc.Models.Menu>
<script>
    $(document).ready(function () {
        $("#mn ul li ul").hide();
        $("#mn ul li span.current").addClass("open").next("ul").show();
        $("#mn ul li a").click(function () {
            $(this).next("ul").slideToggle("slow").parent("li").siblings("li").find("ul:visible").slideUp("slow");
            $("#mn ul li").find("span").removeClass("open");
            $(this).addClass("open");
        });
    })
</script>
@{
    ViewBag.Title = "Index";
}
<div id="mn">
    <ul id="menu" class="unstyled accordion collapse in">
        @foreach (var menu in Model)
        {
            <li><a href="#">@Html.DisplayFor(modelItem => menu.nombre)</a>
                
                    <ul>
                        @foreach (var item in menu.Items)
                        { 
                            <li>
                                @Ajax.ActionLink(item.nombre, item.accion, item.controlador, new AjaxOptions { UpdateTargetId = "content", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" })

                            </li>
                 
                        }

                    </ul>
                
            </li>
        }

    </ul>
</div>
